import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

export function loginByToken(data) {
  return request({
    url: '/admin/login-by-token',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/admin/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  /* return request({
    url: '/admin/logout',
    method: 'post'
  })*/

  const data = { code: 200, data: 'success' }
  return Promise.resolve(data)
}
